<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box{
            /*块级元素开启绝对定位后，类似于行内块元素*/
            position:absolute;
            background-color: #ff8500;
        }
        .title{
            /*行内元素设置了绝对定位可以设置大小*/
            width:50px;
            height:50px;
            position: absolute;
            left:50px;
            background-color: darkmagenta;
        }

        .box1{
            width:500px;
            height:500px;
            background-color: #ffdd9a;
            /*
             overflow: hidden;
            给父盒子添加浮动或绝对定位后就不存在外边距塌陷问题了

            float:left
            */
            position:absolute
        }
        .box2{
            width: 150px;
            height:150px;
            background-color: darkred;
            margin-top: 100px;
        }


    </style>
</head>
<body>
<!--
<div class="box">adc</div>
<span class="title">tittle</span>
-->
<div class="box1">
    <div class="box2"></div>
</div>

</body>
</html>